import numpy as np
from PIL import Image, ImageTk
import random

def readImage(name="pt/5.jpeg"):
    image = Image.open(name)
    return image

def Image2Array(image):
    image_array = np.array(image).astype(np.uint8)
    return image_array

def Array2Photo(image_array):
    image_pho = ImageTk.PhotoImage(Image.fromarray(image_array))
    return image_pho

def Arrays2Photos(image_arrays):
    return [ImageTk.PhotoImage(Image.fromarray(image_array)) for image_array in image_arrays]